Is it possible to disable "the run on AC power" using schtasks.exe cmdline switches
Hello all, I was writing some automation which was using schtasks.exe to schedule various events. After wondering why my events were not launching I have identified that it is because all my systems run on battery and by default when you use schtasks.exe it set the Power Conditions to "Start the task only if the computer is on AC power" Unfortunately after searching and reading technet, I have a bad feeling I cannot programmaticlly disable this condition at the command line. Is there a way? Also if there is not, is there something I can set in the registry to remove this as a default. All my systems which my automation will be used for will be runing on battery. Thus this is a killer, and I don't want to have to hand drive the UI, since my script needs to support all Windows OSes I have the same problem on Vista (only Windows XP is working, as it doesn't have this Power Condition). Thanks for reading and the help.
February 26th, 2010 9:04pm

Hello cshorey,Not seeing an obvious commandline switch for this option.I did notice the option to point to an XML file.So it appears you can create an XML file with options in it.I used the GUI to create a task which does have the option, then queried that task with the xml switch to see what how the XML options were listed.Thanks, Darrell Gorter This posting is provided "AS IS" with no warranties, and confers no rights
Free Windows Admin Tool Kit Click here and download it now
February 27th, 2010 11:12am

Hi Darrell, Thanks for the reply. Yes I saw the XML option and I might have to consider it. I am writing some automation, which needs to support XP, Vista, and Win7. Thus, I wanted just build a command line execution string on the fly based off the OS, but I guess I could build an XML on the fly and then feed it via command line for Vista and Win7. That's a better option then trying to drive the UI. I guess I am just disappointed that there are options which cannot be used via the command line switches. Thanks again. Now I just need to figure out why I am having a 15% failure on my Win7 tasks not running as expected. chris
March 1st, 2010 9:50pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics